package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.ProductUnitService;
import com.atguigu.spzx.model.entity.product.ProductUnit;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: ProductUtilController
 * @Package: com.atguigu.spzx.manager.controller
 * @Description 商品单元
 * @Author 孤妤
 * @Date: 2023/12/8 19:39
 */
@RestController
@RequestMapping("/admin/product/productUnit")
@Tag(name = "商品单元")
public class ProductUnilController {
    @Autowired
    private ProductUnitService productUnitService;
    @GetMapping("/findAllProductUnit")
    @Operation(summary = "查询所有商品单元")
    public Result<List<ProductUnit>> findAllProductUnit(){
        List<ProductUnit> productUnitList = productUnitService.findAllProductUnit();
        return Result.build(productUnitList, ResultCodeEnum.SUCCESS);
    }
}
